home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / program / cpp112.zoo / src / ztype.h < prev   
C/C++ Source or Header  |  1993-09-08  |  2KB  |  37 lines

  1. /*---------------------------------------------------------------------*\
  2. |                                    |
  3. | CPP -- a stand-alone C preprocessor                    |
  4. | Copyright (c) 1993 Hacker Ltd.        Author: Scott Bigham    |
  5. |                                    |
  6. | Permission is granted to anyone to use this software for any purpose    |
  7. | on any computer system, and to redistribute it freely, with the    |
  8. | following restrictions:                        |
  9. | - No charge may be made other than reasonable charges for repro-    |
  10. |     duction.                                |
  11. | - Modified versions must be clearly marked as such.            |
  12. | - The author is not responsible for any harmful consequences of    |
  13. |     using this software, even if they result from defects therein.    |
  14. |                                    |
  15. | ztype.h -- extended ctype macros                    |
  16. \*---------------------------------------------------------------------*/
  17.  
  18. #define Z_ct1 (unsigned char)0x01
  19. #define Z_ct2 (unsigned char)0x02
  20. #define Z_isx (unsigned char)0x03
  21. #define Z_fsx (unsigned char)0x08
  22. #define Z_oct (unsigned char)0x10
  23.  
  24. extern unsigned char Z_type[];
  25. extern void Z_type_init();
  26.  
  27. /* a character that can appear at the start of a C token */
  28. #define is_ctoks(c)    (Z_type[(unsigned char)c]&Z_ct1)
  29. /* a character that can appear within a C token */
  30. #define is_ctok(c)    (Z_type[(unsigned char)c]&Z_ct2)
  31. /* a character that can be a floating-point suffix */
  32. #define is_isuff(c)    (Z_type[(unsigned char)c]&Z_isx)
  33. /* a character that can be an integer suffix */
  34. #define is_fsuff(c)    (Z_type[(unsigned char)c]&Z_fsx)
  35. /* an octal digit */
  36. #define is_octal(c)    (Z_type[(unsigned char)c]&Z_oct)
  37.